package com.example.designpattenexample.mediator;

public abstract class Person {
    public String name;
    public int age;
    public Sex sex;
    public int requestAge;
    public MarriageAgency agency;

    public Person(String name, int age, Sex sex,int requestAge,MarriageAgency agency) {
        this.name = name;
        this.age = age;
        this.requestAge = requestAge;
        this.sex = sex;
        this.agency = agency;
        agency.register(this);
    }

    public void findPartner(){
        agency.pair(this);
    }
}

enum Sex{
    MALE,FEMALE
}
